<template>
  <div class="app-container">
    <!-- 导航栏 -->
    <nav class="navbar">
      <div class="navbar-container">
        <router-link to="/" class="navbar-brand">
          🔒 人脸识别系统
        </router-link>
        <div class="navbar-menu">
          <router-link to="/" class="navbar-item" active-class="active">首页</router-link>
          <router-link to="/register" class="navbar-item" active-class="active">人脸注册</router-link>
          <router-link to="/recognize" class="navbar-item" active-class="active">人脸识别</router-link>
          <router-link to="/users" class="navbar-item" active-class="active">用户管理</router-link>
        </div>
      </div>
    </nav>
    
    <!-- 主内容区域 -->
    <main class="main-content">
      <router-view />
    </main>
    
    <!-- 页脚 -->
    <footer class="footer">
      <div class="footer-container">
        <p>© {{ currentYear }} 人脸识别系统 - 基于图片的身份验证解决方案</p>
      </div>
    </footer>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'

const currentYear = ref(new Date().getFullYear())
</script>

<style>
/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f7fa;
}
</style>

<style scoped>
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-menu {
  display: flex;
  gap: 1rem;
}

.navbar-item {
  color: #666;
  text-decoration: none;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.navbar-item:hover {
  color: #2196F3;
  background: #f5f5f5;
}

.navbar-item.active {
  color: #2196F3;
  font-weight: 500;
  background: #e3f2fd;
}

.main-content {
  flex: 1;
  padding: 2rem 0;
}

.footer {
  background: #333;
  color: white;
  padding: 1.5rem 0;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
  font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar-container {
    padding: 0 1rem;
  }
  
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .navbar-menu {
    gap: 0.5rem;
  }
  
  .navbar-item {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
  }
  
  .main-content {
    padding: 1rem 0;
  }
}
</style>
